<template>
    <el-dialog
        class="dialog"
        :destroy-on-close="true"
        title="重置密码"
        :visible.sync="isShow"
        :close-on-click-modal="false"
        @close="onDialogClose"
    >
        <el-form
            ref="form"
            label-width="auto"
            class="form"
            :model="formData"
            :rules="rules"
        >
            <el-form-item label="姓名" prop="user_xm">
                <el-input
                    v-model="formData.user_xm"
                    placeholder="请输入姓名"
                    maxlength="20"
                    :disabled="isEdit"
                ></el-input>
            </el-form-item>
           
            <el-form-item label="手机号/帐号" prop="phone">
                <el-input
                    v-model="formData.phone"
                    placeholder="请输入手机号/帐号"
                    maxlength="11"
                    :disabled="isEdit"
                ></el-input>
            </el-form-item>
            <el-form-item label="密码" prop="staff_password">
                <el-input
                    v-model="formData.staff_password"
                    placeholder="请输入密码"
                    maxlength="20"
                ></el-input>
            </el-form-item>
        </el-form>
        <div slot="footer" class="dialog-footer">
            <el-button @click="onDialogClose">取消</el-button>
            <el-button type="primary" @click="onSubmit">确认</el-button>
        </div>
    </el-dialog>
</template>

<script lang="ts">
import { Component, Vue } from "vue-property-decorator";
import { Action } from "vuex-class";
import { mixinDialogForm } from "@/mixin/dialog/Form";
@Component({
    mixins: [mixinDialogForm]
})
export default class purviewStaffRePwd extends Vue {
    @Action("purviewStaff/repwd") itemEdit: any;
    editInit(data: any) {
        const me = this as any;
        me.formData = Object.assign({}, me.formData, data);
    }

    // 表单数据
    formData: any = {
        staff_sn: "",
        staff_password: "",
        user_xm: "",
        phone: ""
    };

    rules: any = {
        staff_sn: [
            {
                required: true,
                message: "请输入人员编号",
                trigger: "blur"
            }
        ],
        staff_password: [
            {
                required: true,
                message: "请输入密码",
                trigger: "blur"
            }
        ]
    };

}
</script>
